﻿@model IEnumerable<Domain.Entities.Product>
@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
        <th>ProductName
        </th>
        <th>CreateDate
        </th>
        <th>SaleCount
        </th>
        <th>ClickCount
        </th>
        <th>ThreadID
        </th>
        <th>Info
        </th>
        <th>UserName
        </th>
        <th></th>
    </tr>

    @foreach (var item in Model)
    {
        <tr>
            <td>
                @Html.DisplayFor(modelItem => item.ProductName)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.CreateDate)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.SaleCount)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.ClickCount)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.ThreadID)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Info)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.ProductUser.Name)
            </td>
            <td>
                @Html.ActionLink("Edit", "Edit", new { id = item.ProductID }) |
            @Html.ActionLink("Details", "Details", new { id = item.ProductID }) |
            @Html.ActionLink("Delete", "Delete", new { id = item.ProductID })
            </td>
        </tr>
    }

</table>
